/*
 * Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
 */

package dev.icerock.moko.resources

import dev.icerock.moko.resources.utils.OhosResourceUtils
import kotlin.Any

actual class StringResource(
    val resourceName: String
){
    internal fun getString():String? {
        return OhosResourceUtils.getString(resourceName)?:throw Exception()
    }

    internal fun getFormatString(list: List<Any>):String? {
        return OhosResourceUtils.getString(resourceName, list)?: throw Exception()
    }

    fun test() {
        val testRes = getString()
        println("test StringResource: $testRes")
    }

    fun testFormat() {
        val list: List<Any> = listOf(
            18,
            "xiaowang",
            0.221,
            "xiaoli",
            10086
        )
        val testRes = getFormatString(list)
        println("test StringFormatResource: $testRes")
    }
}